#ifndef NETOBJECT_H
#define NETOBJECT_H

#include <boost/shared_ptr.hpp>
#include "NetWork/Net.hpp"
#include "Logic/LogicTypeDef.h"

class NetObject : public enable_shared_from_this<NetObject>
{
public:
	enum
	{
		Hearbeat_Internal = 10000,
	};
	NetObject(const NetObject_PTR& _other);
	NetObject(Server_Con _pCon);
	virtual bool tick(int deta);
	void resetConnection(Server_Con _pCon);
	ConectionID getConnectionID()const;
	void sendPacket(Packet* pPacket);
	void heartbeatReponse();
	bool isTimeout()const;
	bool isDisconnect()const;
	void setDisconnectedFlage();
	void disconnet();
protected:
	Server_Con m_pCon;
	bool m_bIsDisconnect;
	int m_lastHeartbeat;
	int m_lastHeartbeatReponse;
};


#endif